﻿using WinRTFramework.Interfaces.Contracts.Settings.View;
using Windows.UI.ApplicationSettings;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;

// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236

namespace ApplicationSettings.Settings
{
    public sealed partial class ContextSpecificSettings : UserControl, ICareAboutSettingsEdgeLocation
    {
        // The guidelines recommend using 100px offset for the content animation.
        const int ContentAnimationOffset = 100;

        public ContextSpecificSettings()
        {
            this.InitializeComponent();
        }


        #region ICareAboutSettingsEdgeLocation
        public SettingsEdgeLocation SettingsEdgeLocation
        {
            set
            {
                FlyoutContent.Transitions = new TransitionCollection();
                FlyoutContent.Transitions.Add(new EntranceThemeTransition()
                {
                    FromHorizontalOffset = (value == SettingsEdgeLocation.Right) ? ContentAnimationOffset : (ContentAnimationOffset * -1)
                });
            }
        }
        #endregion
    }
}
